Data-driven Modelling of Structured Populations by Stephen P. Ellner Dylan Z. Childs & Mark Rees
Author:Stephen P. Ellner, Dylan Z. Childs & Mark Rees
Language: eng
Format: epub
Publisher: Springer International Publishing, Cham
Alternatively, we can use the linear algebra routines introduced earlier to compute the leading eigenvalue and eigenvectors (right or left) of an age-size IPM. Sticking with the ARPACK routines, we need to define an R function to iterate the model. We have already done this with r_iter. However, the arpack function expects the age-specific size distributions to be stacked into a single long vector, so we have to wrap r_iter in a function that converts a stacked state vector to the list form our model uses, iterates the model one step, and then converts the new list of age-specific size distributions to the stacked form:
matmul.r <- function(x.vec, IPM.sys) {
with(IPM.sys, {
x.list <- list()
for (ia in seq_len(na)) x.list[[ia]] <- x[seq.int(ia*m-m+1, ia*m)]
unlist(r_iter(x.list, na, F, P))
})
}
We then pass this function to arpack along with IPM.sys to compute the eigenvalue and eigenvector:
eigs.r <- arpack(matmul.r, extra=IPM.sys,
complex=FALSE, options=list(n=with(IPM.sys, m*na), nev=1))
Re(eigs.r$val[1])
So which approach is best, iteration or ARPACK? In this example arpack takes about twice as long as domEig_r with 100 mesh points and 22 age classes, so there isn’t really much between them. They are both fast, taking only a fraction of a second to run on a 4 Ghz workstation.
Are there better alternatives? In an early application Childs et al. (2003) implemented their age-size IPM using a single block matrix, where the F a (z′, z) and P a (z′, z) were stored as submatrices (‘blocks’) arranged so that they resembled a Leslie matrix, with the remaining blocks containing zero elements. This implementation is analogous to the age-stage matrix model originally proposed by Goodman (1969). The matrix was stored as standard matrix object and eigen was used to compute the eigenvalues and eigenvectors. This implementation of the ungulate age-size model is performed by the IPM_list_to_mat function in Ungulate Age Calculations.R. The take home message is that the block matrix approach is very inefficient: the time taken to calculate the leading eigenvalue is nearly 3 orders of magnitude greater than using iteration with the “list form” version of the same model. This difference can be cut to about 1–2 orders of magnitude by switching to ARPACK. The remaining bottleneck occurs because the matrix has approximately 5 million elements. Since most of these are zero, a further speedup may be achieved by using sparse matrix routines, though we have not tested this assertion.
In general, when working with age-size IPMs we recommend storing the size distribution associated with each discrete state in a list, and then writing functions to handle the one-step iteration required to compute eigenvalues and eigenvectors. It is hard to give concrete advice for general continuous-discrete classified IPMs. If the number of discrete states is large but only a small number of transitions among states are possible in a single step, then using the “list form” is probably best. Otherwise, storing all the kernels in one big matrix is probably simpler and will not incur significant efficiency losses. In either case, eigenvalues and eigenvectors should be calculated using iteration or efficient linear algebra routines such as ARPACK.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Anatomy | Animals |
Bacteriology | Biochemistry |
Bioelectricity | Bioinformatics |
Biology | Biophysics |
Biotechnology | Botany |
Ecology | Genetics |
Paleontology | Plants |
Taxonomic Classification | Zoology |
Sapiens: A Brief History of Humankind by Yuval Noah Harari(13918)
The Tidewater Tales by John Barth(12371)
Mastermind: How to Think Like Sherlock Holmes by Maria Konnikova(6893)
Do No Harm Stories of Life, Death and Brain Surgery by Henry Marsh(6658)
The Thirst by Nesbo Jo(6405)
Why We Sleep: Unlocking the Power of Sleep and Dreams by Matthew Walker(6298)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5144)
Sapiens by Yuval Noah Harari(5094)
The Longevity Diet by Valter Longo(4835)
The Body: A Guide for Occupants by Bill Bryson(4535)
The Rules Do Not Apply by Ariel Levy(4482)
The Immortal Life of Henrietta Lacks by Rebecca Skloot(4223)
Why We Sleep by Matthew Walker(4171)
Animal Frequency by Melissa Alvarez(4125)
Yoga Anatomy by Kaminoff Leslie(4083)
The Hacking of the American Mind by Robert H. Lustig(4050)
All Creatures Great and Small by James Herriot(3951)
Barron's AP Biology by Goldberg M.S. Deborah T(3925)
Double Down (Diary of a Wimpy Kid Book 11) by Jeff Kinney(3873)
